package com.aispeech.asr.clib.arpc;

import com.sun.jna.Library;
import com.sun.jna.Pointer;

public interface IARpc extends Library {
    int arpc_init(int loglevel);

    void arpc_finit();

    long arpc_start(String host, int port, IARpcCallback callback, long userdata, String message, int size, int timeout, String sessionId);

    long arpc_start_async(String host, int port, IARpcCallback callback, long userdata, String message, int size, int timeout, String sessionId);

    //int arpc_feed(long instance, byte[] data, int bytes);

    int arpc_feed_async(long instance, byte[] data, int bytes);

    ArpcOutputStruct.ByReference arpc_stop(long instance, int timeout);

    void arpc_stop_async(long instance, int timeout);

    void arpc_close(long instance);

    String arpc_sessionid(long instance);

    JsonBinStruct.ByReference jsonbin_parse(Pointer data, int size);

    void jsonbin_free(JsonBinStruct.ByReference jsonbin);
}
